<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Notice/index')}">院部新闻</a></li>
        <li><a href="{:url('Notice/add')}">添加院部新闻</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('Notice/index')}">

        <input type="text" class="form-control" name="title_author" style="width: 150px;" value="{:input('request.title_author')}" placeholder="请输入标题或作者">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Notice/index')}">清空</a>
    </form>

    <form method="post" class="js-ajax-form margin-top-20" action="{:url('Notice/ListOrder')}">
        <div class="table-actions" >
            <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">排序</button>
            <button class="btn btn-sm btn-success js-ajax-submit" type="submit"
                    data-action="{:url('Link/toggle',array('display'=>1))}" data-subcheck="true">{:lang('DISPLAY')}
            </button>
            <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                    data-action="{:url('Link/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
            </button>
        </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">排序</th>
                <th width="50">ID</th>
                <th>封面</th>
                <th>标题</th>
                <th >浏览量</th>
                <th >作者</th>
                <th >状态</th>
                <th >操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="notice" item="v">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value=""></td>
                    <td><input name='list_orders[{$v.id}]' class="input input-order mr5" type='text'  value='{$v.list_order}'></td>
                    <td>{$v.id}</td>
                    <td><img class="img-thumbnail js-image-previewer" height="30px" width="30px" src="/upload/{$v.image}"></td>
                    <td>{$v.title}</td>
                    <td>{$v.look_num}</td>
                    <td>{$v.author}</td>
                    <td>
                        <eq name="$v.switch" value="1">
                            <a href="{:url('Notice/editSwitch',['id' => $v['id']])}" class="btn btn-sm btn-success js-ajax-dialog-btn" data-msg="确定隐藏吗？">是</a>
                            <else/>
                            <a href="{:url('Notice/editSwitch',['id' => $v['id']])}" class=" btn btn-sm btn-danger js-ajax-dialog-btn" data-msg="确定显示吗？">否</a>

                        </eq>

                    </td>
                    <td>
                        <button type="button" class="btn btn-sm btn-primary" onclick="openIframeLayer('{:url("Notice/getContent",['id' => $v['id']])}','预览文章','')">预览文章</button>
                        <a class="btn btn-xs btn-primary" href="{:url('Notice/edit',)}?id={$v.id}">编辑</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Notice/del',)}?id={$v.id}">删除</a>
                    </td>
                </tr>
            </foreach>
            </tbody>

        </table>
        <div class="pagination">{$notice->render()}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
<script src="__STATIC__/js/js-image-previewer.js"></script>
</body>
</html>
